
/*
'===============================================================================
'  Generated From - CSharp_dOOdads_BusinessEntity.vbgen
' 
'  ** IMPORTANT  ** 
'  How to Generate your stored procedures:
' 
'  SQL        = SQL_StoredProcs.vbgen
'  ACCESS     = Access_StoredProcs.vbgen
'  ORACLE     = Oracle_StoredProcs.vbgen
'  FIREBIRD   = FirebirdStoredProcs.vbgen
'  POSTGRESQL = PostgreSQL_StoredProcs.vbgen
'
'  The supporting base class SqlClientEntity is in the Architecture directory in "dOOdads".
'  
'  This object is 'abstract' which means you need to inherit from it to be able
'  to instantiate it.  This is very easilly done. You can override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  public class YourObject :  _YourObject
'  {
'
'  }
'
'===============================================================================
*/

// Generated by MyGeneration Version # (1.3.0.9)

using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Collections.Specialized;

using MyGeneration.dOOdads;

namespace TA.BE
{
	public class _EMPLOYEE : SqlClientEntity
	{
		public _EMPLOYEE()
		{
			this.QuerySource = "EMPLOYEE";
			this.MappingName = "EMPLOYEE";

		}	

		//=================================================================
		//  public Overrides void AddNew()
		//=================================================================
		//
		//=================================================================
		public override void AddNew()
		{
			base.AddNew();
			
		}
		
		
		public override void FlushData()
		{
			this._whereClause = null;
			this._aggregateClause = null;
			base.FlushData();
		}
		
		//=================================================================
		//  	public Function LoadAll() As Boolean
		//=================================================================
		//  Loads all of the records in the database, and sets the currentRow to the first row
		//=================================================================
		public bool LoadAll() 
		{
			ListDictionary parameters = null;
			
			return base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_EMPLOYEELoadAll]", parameters);
		}
	
		//=================================================================
		// public Overridable Function LoadByPrimaryKey()  As Boolean
		//=================================================================
		//  Loads a single row of via the primary key
		//=================================================================
		public virtual bool LoadByPrimaryKey(int ID)
		{
			ListDictionary parameters = new ListDictionary();
			parameters.Add(Parameters.ID, ID);

		
			return base.LoadFromSql("[" + this.SchemaStoredProcedure + "proc_EMPLOYEELoadByPrimaryKey]", parameters);
		}
		
		#region Parameters
		protected class Parameters
		{
			
			public static SqlParameter ID
			{
				get
				{
					return new SqlParameter("@ID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter EMPLOYEE_CODE
			{
				get
				{
					return new SqlParameter("@EMPLOYEE_CODE", SqlDbType.VarChar, 250);
				}
			}
			
			public static SqlParameter EMPLOYEE_NAME
			{
				get
				{
					return new SqlParameter("@EMPLOYEE_NAME", SqlDbType.VarChar, 250);
				}
			}
			
			public static SqlParameter EMPLOYEE_LASTNAME
			{
				get
				{
					return new SqlParameter("@EMPLOYEE_LASTNAME", SqlDbType.VarChar, 250);
				}
			}
			
			public static SqlParameter EMPLOYEE_PREFIX
			{
				get
				{
					return new SqlParameter("@EMPLOYEE_PREFIX", SqlDbType.VarChar, 50);
				}
			}
			
			public static SqlParameter EMPLOYEE_SEX
			{
				get
				{
					return new SqlParameter("@EMPLOYEE_SEX", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter EMPLOYEE_POSITION_ID
			{
				get
				{
					return new SqlParameter("@EMPLOYEE_POSITION_ID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter EMPLOYEE_DEPARTMENT_ID
			{
				get
				{
					return new SqlParameter("@EMPLOYEE_DEPARTMENT_ID", SqlDbType.Int, 0);
				}
			}
			
			public static SqlParameter EMPLOYEE_BIRTHDATE
			{
				get
				{
					return new SqlParameter("@EMPLOYEE_BIRTHDATE", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter EMPLOYEE_JOINDATE
			{
				get
				{
					return new SqlParameter("@EMPLOYEE_JOINDATE", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter EMPLOYEE_IMAGE
			{
				get
				{
					return new SqlParameter("@EMPLOYEE_IMAGE", SqlDbType.Image, 2147483647);
				}
			}
			
			public static SqlParameter ADDRESS_ADDRESS1
			{
				get
				{
					return new SqlParameter("@ADDRESS_ADDRESS1", SqlDbType.VarChar, 255);
				}
			}
			
			public static SqlParameter ADDRESS_TUMBON
			{
				get
				{
					return new SqlParameter("@ADDRESS_TUMBON", SqlDbType.VarChar, 255);
				}
			}
			
			public static SqlParameter ADDRESS_AUMPUR
			{
				get
				{
					return new SqlParameter("@ADDRESS_AUMPUR", SqlDbType.VarChar, 255);
				}
			}
			
			public static SqlParameter ADDRESS_PROVINCE
			{
				get
				{
					return new SqlParameter("@ADDRESS_PROVINCE", SqlDbType.VarChar, 255);
				}
			}
			
			public static SqlParameter ADDRESS_POSTCODE
			{
				get
				{
					return new SqlParameter("@ADDRESS_POSTCODE", SqlDbType.VarChar, 255);
				}
			}
			
			public static SqlParameter ADDRESS_PHONE_HOME
			{
				get
				{
					return new SqlParameter("@ADDRESS_PHONE_HOME", SqlDbType.VarChar, 2550);
				}
			}
			
			public static SqlParameter ADDRESS_PHONE_MOBILE
			{
				get
				{
					return new SqlParameter("@ADDRESS_PHONE_MOBILE", SqlDbType.VarChar, 255);
				}
			}
			
			public static SqlParameter ADDRESS_EMAIL
			{
				get
				{
					return new SqlParameter("@ADDRESS_EMAIL", SqlDbType.VarChar, 255);
				}
			}
			
			public static SqlParameter EMPLOYEE_DESCRIPTION
			{
				get
				{
					return new SqlParameter("@EMPLOYEE_DESCRIPTION", SqlDbType.VarChar, 255);
				}
			}
			
			public static SqlParameter CREATE_DATE
			{
				get
				{
					return new SqlParameter("@CREATE_DATE", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter CREATE_BY
			{
				get
				{
					return new SqlParameter("@CREATE_BY", SqlDbType.VarChar, 50);
				}
			}
			
			public static SqlParameter UPDATE_DATE
			{
				get
				{
					return new SqlParameter("@UPDATE_DATE", SqlDbType.DateTime, 0);
				}
			}
			
			public static SqlParameter UPDATE_BY
			{
				get
				{
					return new SqlParameter("@UPDATE_BY", SqlDbType.VarChar, 50);
				}
			}
			
		}
		#endregion		
	
		#region ColumnNames
		public class ColumnNames
		{  
            public const string ID = "ID";
            public const string EMPLOYEE_CODE = "EMPLOYEE_CODE";
            public const string EMPLOYEE_NAME = "EMPLOYEE_NAME";
            public const string EMPLOYEE_LASTNAME = "EMPLOYEE_LASTNAME";
            public const string EMPLOYEE_PREFIX = "EMPLOYEE_PREFIX";
            public const string EMPLOYEE_SEX = "EMPLOYEE_SEX";
            public const string EMPLOYEE_POSITION_ID = "EMPLOYEE_POSITION_ID";
            public const string EMPLOYEE_DEPARTMENT_ID = "EMPLOYEE_DEPARTMENT_ID";
            public const string EMPLOYEE_BIRTHDATE = "EMPLOYEE_BIRTHDATE";
            public const string EMPLOYEE_JOINDATE = "EMPLOYEE_JOINDATE";
            public const string EMPLOYEE_IMAGE = "EMPLOYEE_IMAGE";
            public const string ADDRESS_ADDRESS1 = "ADDRESS_ADDRESS1";
            public const string ADDRESS_TUMBON = "ADDRESS_TUMBON";
            public const string ADDRESS_AUMPUR = "ADDRESS_AUMPUR";
            public const string ADDRESS_PROVINCE = "ADDRESS_PROVINCE";
            public const string ADDRESS_POSTCODE = "ADDRESS_POSTCODE";
            public const string ADDRESS_PHONE_HOME = "ADDRESS_PHONE_HOME";
            public const string ADDRESS_PHONE_MOBILE = "ADDRESS_PHONE_MOBILE";
            public const string ADDRESS_EMAIL = "ADDRESS_EMAIL";
            public const string EMPLOYEE_DESCRIPTION = "EMPLOYEE_DESCRIPTION";
            public const string CREATE_DATE = "CREATE_DATE";
            public const string CREATE_BY = "CREATE_BY";
            public const string UPDATE_DATE = "UPDATE_DATE";
            public const string UPDATE_BY = "UPDATE_BY";

			static public string ToPropertyName(string columnName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[ID] = _EMPLOYEE.PropertyNames.ID;
					ht[EMPLOYEE_CODE] = _EMPLOYEE.PropertyNames.EMPLOYEE_CODE;
					ht[EMPLOYEE_NAME] = _EMPLOYEE.PropertyNames.EMPLOYEE_NAME;
					ht[EMPLOYEE_LASTNAME] = _EMPLOYEE.PropertyNames.EMPLOYEE_LASTNAME;
					ht[EMPLOYEE_PREFIX] = _EMPLOYEE.PropertyNames.EMPLOYEE_PREFIX;
					ht[EMPLOYEE_SEX] = _EMPLOYEE.PropertyNames.EMPLOYEE_SEX;
					ht[EMPLOYEE_POSITION_ID] = _EMPLOYEE.PropertyNames.EMPLOYEE_POSITION_ID;
					ht[EMPLOYEE_DEPARTMENT_ID] = _EMPLOYEE.PropertyNames.EMPLOYEE_DEPARTMENT_ID;
					ht[EMPLOYEE_BIRTHDATE] = _EMPLOYEE.PropertyNames.EMPLOYEE_BIRTHDATE;
					ht[EMPLOYEE_JOINDATE] = _EMPLOYEE.PropertyNames.EMPLOYEE_JOINDATE;
					ht[EMPLOYEE_IMAGE] = _EMPLOYEE.PropertyNames.EMPLOYEE_IMAGE;
					ht[ADDRESS_ADDRESS1] = _EMPLOYEE.PropertyNames.ADDRESS_ADDRESS1;
					ht[ADDRESS_TUMBON] = _EMPLOYEE.PropertyNames.ADDRESS_TUMBON;
					ht[ADDRESS_AUMPUR] = _EMPLOYEE.PropertyNames.ADDRESS_AUMPUR;
					ht[ADDRESS_PROVINCE] = _EMPLOYEE.PropertyNames.ADDRESS_PROVINCE;
					ht[ADDRESS_POSTCODE] = _EMPLOYEE.PropertyNames.ADDRESS_POSTCODE;
					ht[ADDRESS_PHONE_HOME] = _EMPLOYEE.PropertyNames.ADDRESS_PHONE_HOME;
					ht[ADDRESS_PHONE_MOBILE] = _EMPLOYEE.PropertyNames.ADDRESS_PHONE_MOBILE;
					ht[ADDRESS_EMAIL] = _EMPLOYEE.PropertyNames.ADDRESS_EMAIL;
					ht[EMPLOYEE_DESCRIPTION] = _EMPLOYEE.PropertyNames.EMPLOYEE_DESCRIPTION;
					ht[CREATE_DATE] = _EMPLOYEE.PropertyNames.CREATE_DATE;
					ht[CREATE_BY] = _EMPLOYEE.PropertyNames.CREATE_BY;
					ht[UPDATE_DATE] = _EMPLOYEE.PropertyNames.UPDATE_DATE;
					ht[UPDATE_BY] = _EMPLOYEE.PropertyNames.UPDATE_BY;

				}
				return (string)ht[columnName];
			}

			static private Hashtable ht = null;			 
		}
		#endregion
		
		#region PropertyNames
		public class PropertyNames
		{  
            public const string ID = "ID";
            public const string EMPLOYEE_CODE = "EMPLOYEE_CODE";
            public const string EMPLOYEE_NAME = "EMPLOYEE_NAME";
            public const string EMPLOYEE_LASTNAME = "EMPLOYEE_LASTNAME";
            public const string EMPLOYEE_PREFIX = "EMPLOYEE_PREFIX";
            public const string EMPLOYEE_SEX = "EMPLOYEE_SEX";
            public const string EMPLOYEE_POSITION_ID = "EMPLOYEE_POSITION_ID";
            public const string EMPLOYEE_DEPARTMENT_ID = "EMPLOYEE_DEPARTMENT_ID";
            public const string EMPLOYEE_BIRTHDATE = "EMPLOYEE_BIRTHDATE";
            public const string EMPLOYEE_JOINDATE = "EMPLOYEE_JOINDATE";
            public const string EMPLOYEE_IMAGE = "EMPLOYEE_IMAGE";
            public const string ADDRESS_ADDRESS1 = "ADDRESS_ADDRESS1";
            public const string ADDRESS_TUMBON = "ADDRESS_TUMBON";
            public const string ADDRESS_AUMPUR = "ADDRESS_AUMPUR";
            public const string ADDRESS_PROVINCE = "ADDRESS_PROVINCE";
            public const string ADDRESS_POSTCODE = "ADDRESS_POSTCODE";
            public const string ADDRESS_PHONE_HOME = "ADDRESS_PHONE_HOME";
            public const string ADDRESS_PHONE_MOBILE = "ADDRESS_PHONE_MOBILE";
            public const string ADDRESS_EMAIL = "ADDRESS_EMAIL";
            public const string EMPLOYEE_DESCRIPTION = "EMPLOYEE_DESCRIPTION";
            public const string CREATE_DATE = "CREATE_DATE";
            public const string CREATE_BY = "CREATE_BY";
            public const string UPDATE_DATE = "UPDATE_DATE";
            public const string UPDATE_BY = "UPDATE_BY";

			static public string ToColumnName(string propertyName)
			{
				if(ht == null)
				{
					ht = new Hashtable();
					
					ht[ID] = _EMPLOYEE.ColumnNames.ID;
					ht[EMPLOYEE_CODE] = _EMPLOYEE.ColumnNames.EMPLOYEE_CODE;
					ht[EMPLOYEE_NAME] = _EMPLOYEE.ColumnNames.EMPLOYEE_NAME;
					ht[EMPLOYEE_LASTNAME] = _EMPLOYEE.ColumnNames.EMPLOYEE_LASTNAME;
					ht[EMPLOYEE_PREFIX] = _EMPLOYEE.ColumnNames.EMPLOYEE_PREFIX;
					ht[EMPLOYEE_SEX] = _EMPLOYEE.ColumnNames.EMPLOYEE_SEX;
					ht[EMPLOYEE_POSITION_ID] = _EMPLOYEE.ColumnNames.EMPLOYEE_POSITION_ID;
					ht[EMPLOYEE_DEPARTMENT_ID] = _EMPLOYEE.ColumnNames.EMPLOYEE_DEPARTMENT_ID;
					ht[EMPLOYEE_BIRTHDATE] = _EMPLOYEE.ColumnNames.EMPLOYEE_BIRTHDATE;
					ht[EMPLOYEE_JOINDATE] = _EMPLOYEE.ColumnNames.EMPLOYEE_JOINDATE;
					ht[EMPLOYEE_IMAGE] = _EMPLOYEE.ColumnNames.EMPLOYEE_IMAGE;
					ht[ADDRESS_ADDRESS1] = _EMPLOYEE.ColumnNames.ADDRESS_ADDRESS1;
					ht[ADDRESS_TUMBON] = _EMPLOYEE.ColumnNames.ADDRESS_TUMBON;
					ht[ADDRESS_AUMPUR] = _EMPLOYEE.ColumnNames.ADDRESS_AUMPUR;
					ht[ADDRESS_PROVINCE] = _EMPLOYEE.ColumnNames.ADDRESS_PROVINCE;
					ht[ADDRESS_POSTCODE] = _EMPLOYEE.ColumnNames.ADDRESS_POSTCODE;
					ht[ADDRESS_PHONE_HOME] = _EMPLOYEE.ColumnNames.ADDRESS_PHONE_HOME;
					ht[ADDRESS_PHONE_MOBILE] = _EMPLOYEE.ColumnNames.ADDRESS_PHONE_MOBILE;
					ht[ADDRESS_EMAIL] = _EMPLOYEE.ColumnNames.ADDRESS_EMAIL;
					ht[EMPLOYEE_DESCRIPTION] = _EMPLOYEE.ColumnNames.EMPLOYEE_DESCRIPTION;
					ht[CREATE_DATE] = _EMPLOYEE.ColumnNames.CREATE_DATE;
					ht[CREATE_BY] = _EMPLOYEE.ColumnNames.CREATE_BY;
					ht[UPDATE_DATE] = _EMPLOYEE.ColumnNames.UPDATE_DATE;
					ht[UPDATE_BY] = _EMPLOYEE.ColumnNames.UPDATE_BY;

				}
				return (string)ht[propertyName];
			}

			static private Hashtable ht = null;			 
		}			 
		#endregion	

		#region StringPropertyNames
		public class StringPropertyNames
		{  
            public const string ID = "s_ID";
            public const string EMPLOYEE_CODE = "s_EMPLOYEE_CODE";
            public const string EMPLOYEE_NAME = "s_EMPLOYEE_NAME";
            public const string EMPLOYEE_LASTNAME = "s_EMPLOYEE_LASTNAME";
            public const string EMPLOYEE_PREFIX = "s_EMPLOYEE_PREFIX";
            public const string EMPLOYEE_SEX = "s_EMPLOYEE_SEX";
            public const string EMPLOYEE_POSITION_ID = "s_EMPLOYEE_POSITION_ID";
            public const string EMPLOYEE_DEPARTMENT_ID = "s_EMPLOYEE_DEPARTMENT_ID";
            public const string EMPLOYEE_BIRTHDATE = "s_EMPLOYEE_BIRTHDATE";
            public const string EMPLOYEE_JOINDATE = "s_EMPLOYEE_JOINDATE";
            public const string ADDRESS_ADDRESS1 = "s_ADDRESS_ADDRESS1";
            public const string ADDRESS_TUMBON = "s_ADDRESS_TUMBON";
            public const string ADDRESS_AUMPUR = "s_ADDRESS_AUMPUR";
            public const string ADDRESS_PROVINCE = "s_ADDRESS_PROVINCE";
            public const string ADDRESS_POSTCODE = "s_ADDRESS_POSTCODE";
            public const string ADDRESS_PHONE_HOME = "s_ADDRESS_PHONE_HOME";
            public const string ADDRESS_PHONE_MOBILE = "s_ADDRESS_PHONE_MOBILE";
            public const string ADDRESS_EMAIL = "s_ADDRESS_EMAIL";
            public const string EMPLOYEE_DESCRIPTION = "s_EMPLOYEE_DESCRIPTION";
            public const string CREATE_DATE = "s_CREATE_DATE";
            public const string CREATE_BY = "s_CREATE_BY";
            public const string UPDATE_DATE = "s_UPDATE_DATE";
            public const string UPDATE_BY = "s_UPDATE_BY";

		}
		#endregion		
		
		#region Properties
	
		public virtual int ID
	    {
			get
	        {
				return base.Getint(ColumnNames.ID);
			}
			set
	        {
				base.Setint(ColumnNames.ID, value);
			}
		}

		public virtual string EMPLOYEE_CODE
	    {
			get
	        {
				return base.Getstring(ColumnNames.EMPLOYEE_CODE);
			}
			set
	        {
				base.Setstring(ColumnNames.EMPLOYEE_CODE, value);
			}
		}

		public virtual string EMPLOYEE_NAME
	    {
			get
	        {
				return base.Getstring(ColumnNames.EMPLOYEE_NAME);
			}
			set
	        {
				base.Setstring(ColumnNames.EMPLOYEE_NAME, value);
			}
		}

		public virtual string EMPLOYEE_LASTNAME
	    {
			get
	        {
				return base.Getstring(ColumnNames.EMPLOYEE_LASTNAME);
			}
			set
	        {
				base.Setstring(ColumnNames.EMPLOYEE_LASTNAME, value);
			}
		}

		public virtual string EMPLOYEE_PREFIX
	    {
			get
	        {
				return base.Getstring(ColumnNames.EMPLOYEE_PREFIX);
			}
			set
	        {
				base.Setstring(ColumnNames.EMPLOYEE_PREFIX, value);
			}
		}

		public virtual int EMPLOYEE_SEX
	    {
			get
	        {
				return base.Getint(ColumnNames.EMPLOYEE_SEX);
			}
			set
	        {
				base.Setint(ColumnNames.EMPLOYEE_SEX, value);
			}
		}

		public virtual int EMPLOYEE_POSITION_ID
	    {
			get
	        {
				return base.Getint(ColumnNames.EMPLOYEE_POSITION_ID);
			}
			set
	        {
				base.Setint(ColumnNames.EMPLOYEE_POSITION_ID, value);
			}
		}

		public virtual int EMPLOYEE_DEPARTMENT_ID
	    {
			get
	        {
				return base.Getint(ColumnNames.EMPLOYEE_DEPARTMENT_ID);
			}
			set
	        {
				base.Setint(ColumnNames.EMPLOYEE_DEPARTMENT_ID, value);
			}
		}

		public virtual DateTime EMPLOYEE_BIRTHDATE
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.EMPLOYEE_BIRTHDATE);
			}
			set
	        {
				base.SetDateTime(ColumnNames.EMPLOYEE_BIRTHDATE, value);
			}
		}

		public virtual DateTime EMPLOYEE_JOINDATE
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.EMPLOYEE_JOINDATE);
			}
			set
	        {
				base.SetDateTime(ColumnNames.EMPLOYEE_JOINDATE, value);
			}
		}

		public virtual byte[] EMPLOYEE_IMAGE
	    {
			get
	        {
				return base.GetByteArray(ColumnNames.EMPLOYEE_IMAGE);
			}
			set
	        {
				base.SetByteArray(ColumnNames.EMPLOYEE_IMAGE, value);
			}
		}

		public virtual string ADDRESS_ADDRESS1
	    {
			get
	        {
				return base.Getstring(ColumnNames.ADDRESS_ADDRESS1);
			}
			set
	        {
				base.Setstring(ColumnNames.ADDRESS_ADDRESS1, value);
			}
		}

		public virtual string ADDRESS_TUMBON
	    {
			get
	        {
				return base.Getstring(ColumnNames.ADDRESS_TUMBON);
			}
			set
	        {
				base.Setstring(ColumnNames.ADDRESS_TUMBON, value);
			}
		}

		public virtual string ADDRESS_AUMPUR
	    {
			get
	        {
				return base.Getstring(ColumnNames.ADDRESS_AUMPUR);
			}
			set
	        {
				base.Setstring(ColumnNames.ADDRESS_AUMPUR, value);
			}
		}

		public virtual string ADDRESS_PROVINCE
	    {
			get
	        {
				return base.Getstring(ColumnNames.ADDRESS_PROVINCE);
			}
			set
	        {
				base.Setstring(ColumnNames.ADDRESS_PROVINCE, value);
			}
		}

		public virtual string ADDRESS_POSTCODE
	    {
			get
	        {
				return base.Getstring(ColumnNames.ADDRESS_POSTCODE);
			}
			set
	        {
				base.Setstring(ColumnNames.ADDRESS_POSTCODE, value);
			}
		}

		public virtual string ADDRESS_PHONE_HOME
	    {
			get
	        {
				return base.Getstring(ColumnNames.ADDRESS_PHONE_HOME);
			}
			set
	        {
				base.Setstring(ColumnNames.ADDRESS_PHONE_HOME, value);
			}
		}

		public virtual string ADDRESS_PHONE_MOBILE
	    {
			get
	        {
				return base.Getstring(ColumnNames.ADDRESS_PHONE_MOBILE);
			}
			set
	        {
				base.Setstring(ColumnNames.ADDRESS_PHONE_MOBILE, value);
			}
		}

		public virtual string ADDRESS_EMAIL
	    {
			get
	        {
				return base.Getstring(ColumnNames.ADDRESS_EMAIL);
			}
			set
	        {
				base.Setstring(ColumnNames.ADDRESS_EMAIL, value);
			}
		}

		public virtual string EMPLOYEE_DESCRIPTION
	    {
			get
	        {
				return base.Getstring(ColumnNames.EMPLOYEE_DESCRIPTION);
			}
			set
	        {
				base.Setstring(ColumnNames.EMPLOYEE_DESCRIPTION, value);
			}
		}

		public virtual DateTime CREATE_DATE
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.CREATE_DATE);
			}
			set
	        {
				base.SetDateTime(ColumnNames.CREATE_DATE, value);
			}
		}

		public virtual string CREATE_BY
	    {
			get
	        {
				return base.Getstring(ColumnNames.CREATE_BY);
			}
			set
	        {
				base.Setstring(ColumnNames.CREATE_BY, value);
			}
		}

		public virtual DateTime UPDATE_DATE
	    {
			get
	        {
				return base.GetDateTime(ColumnNames.UPDATE_DATE);
			}
			set
	        {
				base.SetDateTime(ColumnNames.UPDATE_DATE, value);
			}
		}

		public virtual string UPDATE_BY
	    {
			get
	        {
				return base.Getstring(ColumnNames.UPDATE_BY);
			}
			set
	        {
				base.Setstring(ColumnNames.UPDATE_BY, value);
			}
		}


		#endregion
		
		#region String Properties
	
		public virtual string s_ID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ID) ? string.Empty : base.GetintAsString(ColumnNames.ID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ID);
				else
					this.ID = base.SetintAsString(ColumnNames.ID, value);
			}
		}

		public virtual string s_EMPLOYEE_CODE
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EMPLOYEE_CODE) ? string.Empty : base.GetstringAsString(ColumnNames.EMPLOYEE_CODE);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EMPLOYEE_CODE);
				else
					this.EMPLOYEE_CODE = base.SetstringAsString(ColumnNames.EMPLOYEE_CODE, value);
			}
		}

		public virtual string s_EMPLOYEE_NAME
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EMPLOYEE_NAME) ? string.Empty : base.GetstringAsString(ColumnNames.EMPLOYEE_NAME);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EMPLOYEE_NAME);
				else
					this.EMPLOYEE_NAME = base.SetstringAsString(ColumnNames.EMPLOYEE_NAME, value);
			}
		}

		public virtual string s_EMPLOYEE_LASTNAME
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EMPLOYEE_LASTNAME) ? string.Empty : base.GetstringAsString(ColumnNames.EMPLOYEE_LASTNAME);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EMPLOYEE_LASTNAME);
				else
					this.EMPLOYEE_LASTNAME = base.SetstringAsString(ColumnNames.EMPLOYEE_LASTNAME, value);
			}
		}

		public virtual string s_EMPLOYEE_PREFIX
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EMPLOYEE_PREFIX) ? string.Empty : base.GetstringAsString(ColumnNames.EMPLOYEE_PREFIX);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EMPLOYEE_PREFIX);
				else
					this.EMPLOYEE_PREFIX = base.SetstringAsString(ColumnNames.EMPLOYEE_PREFIX, value);
			}
		}

		public virtual string s_EMPLOYEE_SEX
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EMPLOYEE_SEX) ? string.Empty : base.GetintAsString(ColumnNames.EMPLOYEE_SEX);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EMPLOYEE_SEX);
				else
					this.EMPLOYEE_SEX = base.SetintAsString(ColumnNames.EMPLOYEE_SEX, value);
			}
		}

		public virtual string s_EMPLOYEE_POSITION_ID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EMPLOYEE_POSITION_ID) ? string.Empty : base.GetintAsString(ColumnNames.EMPLOYEE_POSITION_ID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EMPLOYEE_POSITION_ID);
				else
					this.EMPLOYEE_POSITION_ID = base.SetintAsString(ColumnNames.EMPLOYEE_POSITION_ID, value);
			}
		}

		public virtual string s_EMPLOYEE_DEPARTMENT_ID
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EMPLOYEE_DEPARTMENT_ID) ? string.Empty : base.GetintAsString(ColumnNames.EMPLOYEE_DEPARTMENT_ID);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EMPLOYEE_DEPARTMENT_ID);
				else
					this.EMPLOYEE_DEPARTMENT_ID = base.SetintAsString(ColumnNames.EMPLOYEE_DEPARTMENT_ID, value);
			}
		}

		public virtual string s_EMPLOYEE_BIRTHDATE
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EMPLOYEE_BIRTHDATE) ? string.Empty : base.GetDateTimeAsString(ColumnNames.EMPLOYEE_BIRTHDATE);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EMPLOYEE_BIRTHDATE);
				else
					this.EMPLOYEE_BIRTHDATE = base.SetDateTimeAsString(ColumnNames.EMPLOYEE_BIRTHDATE, value);
			}
		}

		public virtual string s_EMPLOYEE_JOINDATE
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EMPLOYEE_JOINDATE) ? string.Empty : base.GetDateTimeAsString(ColumnNames.EMPLOYEE_JOINDATE);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EMPLOYEE_JOINDATE);
				else
					this.EMPLOYEE_JOINDATE = base.SetDateTimeAsString(ColumnNames.EMPLOYEE_JOINDATE, value);
			}
		}

		public virtual string s_ADDRESS_ADDRESS1
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ADDRESS_ADDRESS1) ? string.Empty : base.GetstringAsString(ColumnNames.ADDRESS_ADDRESS1);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ADDRESS_ADDRESS1);
				else
					this.ADDRESS_ADDRESS1 = base.SetstringAsString(ColumnNames.ADDRESS_ADDRESS1, value);
			}
		}

		public virtual string s_ADDRESS_TUMBON
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ADDRESS_TUMBON) ? string.Empty : base.GetstringAsString(ColumnNames.ADDRESS_TUMBON);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ADDRESS_TUMBON);
				else
					this.ADDRESS_TUMBON = base.SetstringAsString(ColumnNames.ADDRESS_TUMBON, value);
			}
		}

		public virtual string s_ADDRESS_AUMPUR
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ADDRESS_AUMPUR) ? string.Empty : base.GetstringAsString(ColumnNames.ADDRESS_AUMPUR);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ADDRESS_AUMPUR);
				else
					this.ADDRESS_AUMPUR = base.SetstringAsString(ColumnNames.ADDRESS_AUMPUR, value);
			}
		}

		public virtual string s_ADDRESS_PROVINCE
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ADDRESS_PROVINCE) ? string.Empty : base.GetstringAsString(ColumnNames.ADDRESS_PROVINCE);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ADDRESS_PROVINCE);
				else
					this.ADDRESS_PROVINCE = base.SetstringAsString(ColumnNames.ADDRESS_PROVINCE, value);
			}
		}

		public virtual string s_ADDRESS_POSTCODE
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ADDRESS_POSTCODE) ? string.Empty : base.GetstringAsString(ColumnNames.ADDRESS_POSTCODE);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ADDRESS_POSTCODE);
				else
					this.ADDRESS_POSTCODE = base.SetstringAsString(ColumnNames.ADDRESS_POSTCODE, value);
			}
		}

		public virtual string s_ADDRESS_PHONE_HOME
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ADDRESS_PHONE_HOME) ? string.Empty : base.GetstringAsString(ColumnNames.ADDRESS_PHONE_HOME);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ADDRESS_PHONE_HOME);
				else
					this.ADDRESS_PHONE_HOME = base.SetstringAsString(ColumnNames.ADDRESS_PHONE_HOME, value);
			}
		}

		public virtual string s_ADDRESS_PHONE_MOBILE
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ADDRESS_PHONE_MOBILE) ? string.Empty : base.GetstringAsString(ColumnNames.ADDRESS_PHONE_MOBILE);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ADDRESS_PHONE_MOBILE);
				else
					this.ADDRESS_PHONE_MOBILE = base.SetstringAsString(ColumnNames.ADDRESS_PHONE_MOBILE, value);
			}
		}

		public virtual string s_ADDRESS_EMAIL
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.ADDRESS_EMAIL) ? string.Empty : base.GetstringAsString(ColumnNames.ADDRESS_EMAIL);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.ADDRESS_EMAIL);
				else
					this.ADDRESS_EMAIL = base.SetstringAsString(ColumnNames.ADDRESS_EMAIL, value);
			}
		}

		public virtual string s_EMPLOYEE_DESCRIPTION
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.EMPLOYEE_DESCRIPTION) ? string.Empty : base.GetstringAsString(ColumnNames.EMPLOYEE_DESCRIPTION);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.EMPLOYEE_DESCRIPTION);
				else
					this.EMPLOYEE_DESCRIPTION = base.SetstringAsString(ColumnNames.EMPLOYEE_DESCRIPTION, value);
			}
		}

		public virtual string s_CREATE_DATE
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.CREATE_DATE) ? string.Empty : base.GetDateTimeAsString(ColumnNames.CREATE_DATE);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.CREATE_DATE);
				else
					this.CREATE_DATE = base.SetDateTimeAsString(ColumnNames.CREATE_DATE, value);
			}
		}

		public virtual string s_CREATE_BY
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.CREATE_BY) ? string.Empty : base.GetstringAsString(ColumnNames.CREATE_BY);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.CREATE_BY);
				else
					this.CREATE_BY = base.SetstringAsString(ColumnNames.CREATE_BY, value);
			}
		}

		public virtual string s_UPDATE_DATE
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.UPDATE_DATE) ? string.Empty : base.GetDateTimeAsString(ColumnNames.UPDATE_DATE);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.UPDATE_DATE);
				else
					this.UPDATE_DATE = base.SetDateTimeAsString(ColumnNames.UPDATE_DATE, value);
			}
		}

		public virtual string s_UPDATE_BY
	    {
			get
	        {
				return this.IsColumnNull(ColumnNames.UPDATE_BY) ? string.Empty : base.GetstringAsString(ColumnNames.UPDATE_BY);
			}
			set
	        {
				if(string.Empty == value)
					this.SetColumnNull(ColumnNames.UPDATE_BY);
				else
					this.UPDATE_BY = base.SetstringAsString(ColumnNames.UPDATE_BY, value);
			}
		}


		#endregion		
	
		#region Where Clause
		public class WhereClause
		{
			public WhereClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffWhereParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffWhereParameter(this);
					}

					return _tearOff;
				}
			}

			#region WhereParameter TearOff's
			public class TearOffWhereParameter
			{
				public TearOffWhereParameter(WhereClause clause)
				{
					this._clause = clause;
				}
				
				
				public WhereParameter ID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ID, Parameters.ID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EMPLOYEE_CODE
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EMPLOYEE_CODE, Parameters.EMPLOYEE_CODE);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EMPLOYEE_NAME
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EMPLOYEE_NAME, Parameters.EMPLOYEE_NAME);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EMPLOYEE_LASTNAME
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EMPLOYEE_LASTNAME, Parameters.EMPLOYEE_LASTNAME);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EMPLOYEE_PREFIX
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EMPLOYEE_PREFIX, Parameters.EMPLOYEE_PREFIX);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EMPLOYEE_SEX
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EMPLOYEE_SEX, Parameters.EMPLOYEE_SEX);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EMPLOYEE_POSITION_ID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EMPLOYEE_POSITION_ID, Parameters.EMPLOYEE_POSITION_ID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EMPLOYEE_DEPARTMENT_ID
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EMPLOYEE_DEPARTMENT_ID, Parameters.EMPLOYEE_DEPARTMENT_ID);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EMPLOYEE_BIRTHDATE
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EMPLOYEE_BIRTHDATE, Parameters.EMPLOYEE_BIRTHDATE);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EMPLOYEE_JOINDATE
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EMPLOYEE_JOINDATE, Parameters.EMPLOYEE_JOINDATE);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EMPLOYEE_IMAGE
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EMPLOYEE_IMAGE, Parameters.EMPLOYEE_IMAGE);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter ADDRESS_ADDRESS1
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ADDRESS_ADDRESS1, Parameters.ADDRESS_ADDRESS1);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter ADDRESS_TUMBON
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ADDRESS_TUMBON, Parameters.ADDRESS_TUMBON);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter ADDRESS_AUMPUR
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ADDRESS_AUMPUR, Parameters.ADDRESS_AUMPUR);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter ADDRESS_PROVINCE
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ADDRESS_PROVINCE, Parameters.ADDRESS_PROVINCE);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter ADDRESS_POSTCODE
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ADDRESS_POSTCODE, Parameters.ADDRESS_POSTCODE);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter ADDRESS_PHONE_HOME
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ADDRESS_PHONE_HOME, Parameters.ADDRESS_PHONE_HOME);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter ADDRESS_PHONE_MOBILE
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ADDRESS_PHONE_MOBILE, Parameters.ADDRESS_PHONE_MOBILE);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter ADDRESS_EMAIL
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.ADDRESS_EMAIL, Parameters.ADDRESS_EMAIL);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter EMPLOYEE_DESCRIPTION
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.EMPLOYEE_DESCRIPTION, Parameters.EMPLOYEE_DESCRIPTION);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter CREATE_DATE
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.CREATE_DATE, Parameters.CREATE_DATE);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter CREATE_BY
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.CREATE_BY, Parameters.CREATE_BY);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter UPDATE_DATE
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.UPDATE_DATE, Parameters.UPDATE_DATE);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}

				public WhereParameter UPDATE_BY
				{
					get
					{
							WhereParameter where = new WhereParameter(ColumnNames.UPDATE_BY, Parameters.UPDATE_BY);
							this._clause._entity.Query.AddWhereParameter(where);
							return where;
					}
				}


				private WhereClause _clause;
			}
			#endregion
		
			public WhereParameter ID
		    {
				get
		        {
					if(_ID_W == null)
	        	    {
						_ID_W = TearOff.ID;
					}
					return _ID_W;
				}
			}

			public WhereParameter EMPLOYEE_CODE
		    {
				get
		        {
					if(_EMPLOYEE_CODE_W == null)
	        	    {
						_EMPLOYEE_CODE_W = TearOff.EMPLOYEE_CODE;
					}
					return _EMPLOYEE_CODE_W;
				}
			}

			public WhereParameter EMPLOYEE_NAME
		    {
				get
		        {
					if(_EMPLOYEE_NAME_W == null)
	        	    {
						_EMPLOYEE_NAME_W = TearOff.EMPLOYEE_NAME;
					}
					return _EMPLOYEE_NAME_W;
				}
			}

			public WhereParameter EMPLOYEE_LASTNAME
		    {
				get
		        {
					if(_EMPLOYEE_LASTNAME_W == null)
	        	    {
						_EMPLOYEE_LASTNAME_W = TearOff.EMPLOYEE_LASTNAME;
					}
					return _EMPLOYEE_LASTNAME_W;
				}
			}

			public WhereParameter EMPLOYEE_PREFIX
		    {
				get
		        {
					if(_EMPLOYEE_PREFIX_W == null)
	        	    {
						_EMPLOYEE_PREFIX_W = TearOff.EMPLOYEE_PREFIX;
					}
					return _EMPLOYEE_PREFIX_W;
				}
			}

			public WhereParameter EMPLOYEE_SEX
		    {
				get
		        {
					if(_EMPLOYEE_SEX_W == null)
	        	    {
						_EMPLOYEE_SEX_W = TearOff.EMPLOYEE_SEX;
					}
					return _EMPLOYEE_SEX_W;
				}
			}

			public WhereParameter EMPLOYEE_POSITION_ID
		    {
				get
		        {
					if(_EMPLOYEE_POSITION_ID_W == null)
	        	    {
						_EMPLOYEE_POSITION_ID_W = TearOff.EMPLOYEE_POSITION_ID;
					}
					return _EMPLOYEE_POSITION_ID_W;
				}
			}

			public WhereParameter EMPLOYEE_DEPARTMENT_ID
		    {
				get
		        {
					if(_EMPLOYEE_DEPARTMENT_ID_W == null)
	        	    {
						_EMPLOYEE_DEPARTMENT_ID_W = TearOff.EMPLOYEE_DEPARTMENT_ID;
					}
					return _EMPLOYEE_DEPARTMENT_ID_W;
				}
			}

			public WhereParameter EMPLOYEE_BIRTHDATE
		    {
				get
		        {
					if(_EMPLOYEE_BIRTHDATE_W == null)
	        	    {
						_EMPLOYEE_BIRTHDATE_W = TearOff.EMPLOYEE_BIRTHDATE;
					}
					return _EMPLOYEE_BIRTHDATE_W;
				}
			}

			public WhereParameter EMPLOYEE_JOINDATE
		    {
				get
		        {
					if(_EMPLOYEE_JOINDATE_W == null)
	        	    {
						_EMPLOYEE_JOINDATE_W = TearOff.EMPLOYEE_JOINDATE;
					}
					return _EMPLOYEE_JOINDATE_W;
				}
			}

			public WhereParameter EMPLOYEE_IMAGE
		    {
				get
		        {
					if(_EMPLOYEE_IMAGE_W == null)
	        	    {
						_EMPLOYEE_IMAGE_W = TearOff.EMPLOYEE_IMAGE;
					}
					return _EMPLOYEE_IMAGE_W;
				}
			}

			public WhereParameter ADDRESS_ADDRESS1
		    {
				get
		        {
					if(_ADDRESS_ADDRESS1_W == null)
	        	    {
						_ADDRESS_ADDRESS1_W = TearOff.ADDRESS_ADDRESS1;
					}
					return _ADDRESS_ADDRESS1_W;
				}
			}

			public WhereParameter ADDRESS_TUMBON
		    {
				get
		        {
					if(_ADDRESS_TUMBON_W == null)
	        	    {
						_ADDRESS_TUMBON_W = TearOff.ADDRESS_TUMBON;
					}
					return _ADDRESS_TUMBON_W;
				}
			}

			public WhereParameter ADDRESS_AUMPUR
		    {
				get
		        {
					if(_ADDRESS_AUMPUR_W == null)
	        	    {
						_ADDRESS_AUMPUR_W = TearOff.ADDRESS_AUMPUR;
					}
					return _ADDRESS_AUMPUR_W;
				}
			}

			public WhereParameter ADDRESS_PROVINCE
		    {
				get
		        {
					if(_ADDRESS_PROVINCE_W == null)
	        	    {
						_ADDRESS_PROVINCE_W = TearOff.ADDRESS_PROVINCE;
					}
					return _ADDRESS_PROVINCE_W;
				}
			}

			public WhereParameter ADDRESS_POSTCODE
		    {
				get
		        {
					if(_ADDRESS_POSTCODE_W == null)
	        	    {
						_ADDRESS_POSTCODE_W = TearOff.ADDRESS_POSTCODE;
					}
					return _ADDRESS_POSTCODE_W;
				}
			}

			public WhereParameter ADDRESS_PHONE_HOME
		    {
				get
		        {
					if(_ADDRESS_PHONE_HOME_W == null)
	        	    {
						_ADDRESS_PHONE_HOME_W = TearOff.ADDRESS_PHONE_HOME;
					}
					return _ADDRESS_PHONE_HOME_W;
				}
			}

			public WhereParameter ADDRESS_PHONE_MOBILE
		    {
				get
		        {
					if(_ADDRESS_PHONE_MOBILE_W == null)
	        	    {
						_ADDRESS_PHONE_MOBILE_W = TearOff.ADDRESS_PHONE_MOBILE;
					}
					return _ADDRESS_PHONE_MOBILE_W;
				}
			}

			public WhereParameter ADDRESS_EMAIL
		    {
				get
		        {
					if(_ADDRESS_EMAIL_W == null)
	        	    {
						_ADDRESS_EMAIL_W = TearOff.ADDRESS_EMAIL;
					}
					return _ADDRESS_EMAIL_W;
				}
			}

			public WhereParameter EMPLOYEE_DESCRIPTION
		    {
				get
		        {
					if(_EMPLOYEE_DESCRIPTION_W == null)
	        	    {
						_EMPLOYEE_DESCRIPTION_W = TearOff.EMPLOYEE_DESCRIPTION;
					}
					return _EMPLOYEE_DESCRIPTION_W;
				}
			}

			public WhereParameter CREATE_DATE
		    {
				get
		        {
					if(_CREATE_DATE_W == null)
	        	    {
						_CREATE_DATE_W = TearOff.CREATE_DATE;
					}
					return _CREATE_DATE_W;
				}
			}

			public WhereParameter CREATE_BY
		    {
				get
		        {
					if(_CREATE_BY_W == null)
	        	    {
						_CREATE_BY_W = TearOff.CREATE_BY;
					}
					return _CREATE_BY_W;
				}
			}

			public WhereParameter UPDATE_DATE
		    {
				get
		        {
					if(_UPDATE_DATE_W == null)
	        	    {
						_UPDATE_DATE_W = TearOff.UPDATE_DATE;
					}
					return _UPDATE_DATE_W;
				}
			}

			public WhereParameter UPDATE_BY
		    {
				get
		        {
					if(_UPDATE_BY_W == null)
	        	    {
						_UPDATE_BY_W = TearOff.UPDATE_BY;
					}
					return _UPDATE_BY_W;
				}
			}

			private WhereParameter _ID_W = null;
			private WhereParameter _EMPLOYEE_CODE_W = null;
			private WhereParameter _EMPLOYEE_NAME_W = null;
			private WhereParameter _EMPLOYEE_LASTNAME_W = null;
			private WhereParameter _EMPLOYEE_PREFIX_W = null;
			private WhereParameter _EMPLOYEE_SEX_W = null;
			private WhereParameter _EMPLOYEE_POSITION_ID_W = null;
			private WhereParameter _EMPLOYEE_DEPARTMENT_ID_W = null;
			private WhereParameter _EMPLOYEE_BIRTHDATE_W = null;
			private WhereParameter _EMPLOYEE_JOINDATE_W = null;
			private WhereParameter _EMPLOYEE_IMAGE_W = null;
			private WhereParameter _ADDRESS_ADDRESS1_W = null;
			private WhereParameter _ADDRESS_TUMBON_W = null;
			private WhereParameter _ADDRESS_AUMPUR_W = null;
			private WhereParameter _ADDRESS_PROVINCE_W = null;
			private WhereParameter _ADDRESS_POSTCODE_W = null;
			private WhereParameter _ADDRESS_PHONE_HOME_W = null;
			private WhereParameter _ADDRESS_PHONE_MOBILE_W = null;
			private WhereParameter _ADDRESS_EMAIL_W = null;
			private WhereParameter _EMPLOYEE_DESCRIPTION_W = null;
			private WhereParameter _CREATE_DATE_W = null;
			private WhereParameter _CREATE_BY_W = null;
			private WhereParameter _UPDATE_DATE_W = null;
			private WhereParameter _UPDATE_BY_W = null;

			public void WhereClauseReset()
			{
				_ID_W = null;
				_EMPLOYEE_CODE_W = null;
				_EMPLOYEE_NAME_W = null;
				_EMPLOYEE_LASTNAME_W = null;
				_EMPLOYEE_PREFIX_W = null;
				_EMPLOYEE_SEX_W = null;
				_EMPLOYEE_POSITION_ID_W = null;
				_EMPLOYEE_DEPARTMENT_ID_W = null;
				_EMPLOYEE_BIRTHDATE_W = null;
				_EMPLOYEE_JOINDATE_W = null;
				_EMPLOYEE_IMAGE_W = null;
				_ADDRESS_ADDRESS1_W = null;
				_ADDRESS_TUMBON_W = null;
				_ADDRESS_AUMPUR_W = null;
				_ADDRESS_PROVINCE_W = null;
				_ADDRESS_POSTCODE_W = null;
				_ADDRESS_PHONE_HOME_W = null;
				_ADDRESS_PHONE_MOBILE_W = null;
				_ADDRESS_EMAIL_W = null;
				_EMPLOYEE_DESCRIPTION_W = null;
				_CREATE_DATE_W = null;
				_CREATE_BY_W = null;
				_UPDATE_DATE_W = null;
				_UPDATE_BY_W = null;

				this._entity.Query.FlushWhereParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffWhereParameter _tearOff;
			
		}
	
		public WhereClause Where
		{
			get
			{
				if(_whereClause == null)
				{
					_whereClause = new WhereClause(this);
				}
		
				return _whereClause;
			}
		}
		
		private WhereClause _whereClause = null;	
		#endregion
	
		#region Aggregate Clause
		public class AggregateClause
		{
			public AggregateClause(BusinessEntity entity)
			{
				this._entity = entity;
			}
			
			public TearOffAggregateParameter TearOff
			{
				get
				{
					if(_tearOff == null)
					{
						_tearOff = new TearOffAggregateParameter(this);
					}

					return _tearOff;
				}
			}

			#region AggregateParameter TearOff's
			public class TearOffAggregateParameter
			{
				public TearOffAggregateParameter(AggregateClause clause)
				{
					this._clause = clause;
				}
				
				
				public AggregateParameter ID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ID, Parameters.ID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EMPLOYEE_CODE
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EMPLOYEE_CODE, Parameters.EMPLOYEE_CODE);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EMPLOYEE_NAME
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EMPLOYEE_NAME, Parameters.EMPLOYEE_NAME);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EMPLOYEE_LASTNAME
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EMPLOYEE_LASTNAME, Parameters.EMPLOYEE_LASTNAME);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EMPLOYEE_PREFIX
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EMPLOYEE_PREFIX, Parameters.EMPLOYEE_PREFIX);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EMPLOYEE_SEX
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EMPLOYEE_SEX, Parameters.EMPLOYEE_SEX);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EMPLOYEE_POSITION_ID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EMPLOYEE_POSITION_ID, Parameters.EMPLOYEE_POSITION_ID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EMPLOYEE_DEPARTMENT_ID
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EMPLOYEE_DEPARTMENT_ID, Parameters.EMPLOYEE_DEPARTMENT_ID);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EMPLOYEE_BIRTHDATE
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EMPLOYEE_BIRTHDATE, Parameters.EMPLOYEE_BIRTHDATE);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EMPLOYEE_JOINDATE
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EMPLOYEE_JOINDATE, Parameters.EMPLOYEE_JOINDATE);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EMPLOYEE_IMAGE
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EMPLOYEE_IMAGE, Parameters.EMPLOYEE_IMAGE);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter ADDRESS_ADDRESS1
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ADDRESS_ADDRESS1, Parameters.ADDRESS_ADDRESS1);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter ADDRESS_TUMBON
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ADDRESS_TUMBON, Parameters.ADDRESS_TUMBON);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter ADDRESS_AUMPUR
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ADDRESS_AUMPUR, Parameters.ADDRESS_AUMPUR);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter ADDRESS_PROVINCE
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ADDRESS_PROVINCE, Parameters.ADDRESS_PROVINCE);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter ADDRESS_POSTCODE
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ADDRESS_POSTCODE, Parameters.ADDRESS_POSTCODE);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter ADDRESS_PHONE_HOME
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ADDRESS_PHONE_HOME, Parameters.ADDRESS_PHONE_HOME);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter ADDRESS_PHONE_MOBILE
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ADDRESS_PHONE_MOBILE, Parameters.ADDRESS_PHONE_MOBILE);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter ADDRESS_EMAIL
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.ADDRESS_EMAIL, Parameters.ADDRESS_EMAIL);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter EMPLOYEE_DESCRIPTION
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.EMPLOYEE_DESCRIPTION, Parameters.EMPLOYEE_DESCRIPTION);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter CREATE_DATE
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.CREATE_DATE, Parameters.CREATE_DATE);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter CREATE_BY
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.CREATE_BY, Parameters.CREATE_BY);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter UPDATE_DATE
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.UPDATE_DATE, Parameters.UPDATE_DATE);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}

				public AggregateParameter UPDATE_BY
				{
					get
					{
							AggregateParameter aggregate = new AggregateParameter(ColumnNames.UPDATE_BY, Parameters.UPDATE_BY);
							this._clause._entity.Query.AddAggregateParameter(aggregate);
							return aggregate;
					}
				}


				private AggregateClause _clause;
			}
			#endregion
		
			public AggregateParameter ID
		    {
				get
		        {
					if(_ID_W == null)
	        	    {
						_ID_W = TearOff.ID;
					}
					return _ID_W;
				}
			}

			public AggregateParameter EMPLOYEE_CODE
		    {
				get
		        {
					if(_EMPLOYEE_CODE_W == null)
	        	    {
						_EMPLOYEE_CODE_W = TearOff.EMPLOYEE_CODE;
					}
					return _EMPLOYEE_CODE_W;
				}
			}

			public AggregateParameter EMPLOYEE_NAME
		    {
				get
		        {
					if(_EMPLOYEE_NAME_W == null)
	        	    {
						_EMPLOYEE_NAME_W = TearOff.EMPLOYEE_NAME;
					}
					return _EMPLOYEE_NAME_W;
				}
			}

			public AggregateParameter EMPLOYEE_LASTNAME
		    {
				get
		        {
					if(_EMPLOYEE_LASTNAME_W == null)
	        	    {
						_EMPLOYEE_LASTNAME_W = TearOff.EMPLOYEE_LASTNAME;
					}
					return _EMPLOYEE_LASTNAME_W;
				}
			}

			public AggregateParameter EMPLOYEE_PREFIX
		    {
				get
		        {
					if(_EMPLOYEE_PREFIX_W == null)
	        	    {
						_EMPLOYEE_PREFIX_W = TearOff.EMPLOYEE_PREFIX;
					}
					return _EMPLOYEE_PREFIX_W;
				}
			}

			public AggregateParameter EMPLOYEE_SEX
		    {
				get
		        {
					if(_EMPLOYEE_SEX_W == null)
	        	    {
						_EMPLOYEE_SEX_W = TearOff.EMPLOYEE_SEX;
					}
					return _EMPLOYEE_SEX_W;
				}
			}

			public AggregateParameter EMPLOYEE_POSITION_ID
		    {
				get
		        {
					if(_EMPLOYEE_POSITION_ID_W == null)
	        	    {
						_EMPLOYEE_POSITION_ID_W = TearOff.EMPLOYEE_POSITION_ID;
					}
					return _EMPLOYEE_POSITION_ID_W;
				}
			}

			public AggregateParameter EMPLOYEE_DEPARTMENT_ID
		    {
				get
		        {
					if(_EMPLOYEE_DEPARTMENT_ID_W == null)
	        	    {
						_EMPLOYEE_DEPARTMENT_ID_W = TearOff.EMPLOYEE_DEPARTMENT_ID;
					}
					return _EMPLOYEE_DEPARTMENT_ID_W;
				}
			}

			public AggregateParameter EMPLOYEE_BIRTHDATE
		    {
				get
		        {
					if(_EMPLOYEE_BIRTHDATE_W == null)
	        	    {
						_EMPLOYEE_BIRTHDATE_W = TearOff.EMPLOYEE_BIRTHDATE;
					}
					return _EMPLOYEE_BIRTHDATE_W;
				}
			}

			public AggregateParameter EMPLOYEE_JOINDATE
		    {
				get
		        {
					if(_EMPLOYEE_JOINDATE_W == null)
	        	    {
						_EMPLOYEE_JOINDATE_W = TearOff.EMPLOYEE_JOINDATE;
					}
					return _EMPLOYEE_JOINDATE_W;
				}
			}

			public AggregateParameter EMPLOYEE_IMAGE
		    {
				get
		        {
					if(_EMPLOYEE_IMAGE_W == null)
	        	    {
						_EMPLOYEE_IMAGE_W = TearOff.EMPLOYEE_IMAGE;
					}
					return _EMPLOYEE_IMAGE_W;
				}
			}

			public AggregateParameter ADDRESS_ADDRESS1
		    {
				get
		        {
					if(_ADDRESS_ADDRESS1_W == null)
	        	    {
						_ADDRESS_ADDRESS1_W = TearOff.ADDRESS_ADDRESS1;
					}
					return _ADDRESS_ADDRESS1_W;
				}
			}

			public AggregateParameter ADDRESS_TUMBON
		    {
				get
		        {
					if(_ADDRESS_TUMBON_W == null)
	        	    {
						_ADDRESS_TUMBON_W = TearOff.ADDRESS_TUMBON;
					}
					return _ADDRESS_TUMBON_W;
				}
			}

			public AggregateParameter ADDRESS_AUMPUR
		    {
				get
		        {
					if(_ADDRESS_AUMPUR_W == null)
	        	    {
						_ADDRESS_AUMPUR_W = TearOff.ADDRESS_AUMPUR;
					}
					return _ADDRESS_AUMPUR_W;
				}
			}

			public AggregateParameter ADDRESS_PROVINCE
		    {
				get
		        {
					if(_ADDRESS_PROVINCE_W == null)
	        	    {
						_ADDRESS_PROVINCE_W = TearOff.ADDRESS_PROVINCE;
					}
					return _ADDRESS_PROVINCE_W;
				}
			}

			public AggregateParameter ADDRESS_POSTCODE
		    {
				get
		        {
					if(_ADDRESS_POSTCODE_W == null)
	        	    {
						_ADDRESS_POSTCODE_W = TearOff.ADDRESS_POSTCODE;
					}
					return _ADDRESS_POSTCODE_W;
				}
			}

			public AggregateParameter ADDRESS_PHONE_HOME
		    {
				get
		        {
					if(_ADDRESS_PHONE_HOME_W == null)
	        	    {
						_ADDRESS_PHONE_HOME_W = TearOff.ADDRESS_PHONE_HOME;
					}
					return _ADDRESS_PHONE_HOME_W;
				}
			}

			public AggregateParameter ADDRESS_PHONE_MOBILE
		    {
				get
		        {
					if(_ADDRESS_PHONE_MOBILE_W == null)
	        	    {
						_ADDRESS_PHONE_MOBILE_W = TearOff.ADDRESS_PHONE_MOBILE;
					}
					return _ADDRESS_PHONE_MOBILE_W;
				}
			}

			public AggregateParameter ADDRESS_EMAIL
		    {
				get
		        {
					if(_ADDRESS_EMAIL_W == null)
	        	    {
						_ADDRESS_EMAIL_W = TearOff.ADDRESS_EMAIL;
					}
					return _ADDRESS_EMAIL_W;
				}
			}

			public AggregateParameter EMPLOYEE_DESCRIPTION
		    {
				get
		        {
					if(_EMPLOYEE_DESCRIPTION_W == null)
	        	    {
						_EMPLOYEE_DESCRIPTION_W = TearOff.EMPLOYEE_DESCRIPTION;
					}
					return _EMPLOYEE_DESCRIPTION_W;
				}
			}

			public AggregateParameter CREATE_DATE
		    {
				get
		        {
					if(_CREATE_DATE_W == null)
	        	    {
						_CREATE_DATE_W = TearOff.CREATE_DATE;
					}
					return _CREATE_DATE_W;
				}
			}

			public AggregateParameter CREATE_BY
		    {
				get
		        {
					if(_CREATE_BY_W == null)
	        	    {
						_CREATE_BY_W = TearOff.CREATE_BY;
					}
					return _CREATE_BY_W;
				}
			}

			public AggregateParameter UPDATE_DATE
		    {
				get
		        {
					if(_UPDATE_DATE_W == null)
	        	    {
						_UPDATE_DATE_W = TearOff.UPDATE_DATE;
					}
					return _UPDATE_DATE_W;
				}
			}

			public AggregateParameter UPDATE_BY
		    {
				get
		        {
					if(_UPDATE_BY_W == null)
	        	    {
						_UPDATE_BY_W = TearOff.UPDATE_BY;
					}
					return _UPDATE_BY_W;
				}
			}

			private AggregateParameter _ID_W = null;
			private AggregateParameter _EMPLOYEE_CODE_W = null;
			private AggregateParameter _EMPLOYEE_NAME_W = null;
			private AggregateParameter _EMPLOYEE_LASTNAME_W = null;
			private AggregateParameter _EMPLOYEE_PREFIX_W = null;
			private AggregateParameter _EMPLOYEE_SEX_W = null;
			private AggregateParameter _EMPLOYEE_POSITION_ID_W = null;
			private AggregateParameter _EMPLOYEE_DEPARTMENT_ID_W = null;
			private AggregateParameter _EMPLOYEE_BIRTHDATE_W = null;
			private AggregateParameter _EMPLOYEE_JOINDATE_W = null;
			private AggregateParameter _EMPLOYEE_IMAGE_W = null;
			private AggregateParameter _ADDRESS_ADDRESS1_W = null;
			private AggregateParameter _ADDRESS_TUMBON_W = null;
			private AggregateParameter _ADDRESS_AUMPUR_W = null;
			private AggregateParameter _ADDRESS_PROVINCE_W = null;
			private AggregateParameter _ADDRESS_POSTCODE_W = null;
			private AggregateParameter _ADDRESS_PHONE_HOME_W = null;
			private AggregateParameter _ADDRESS_PHONE_MOBILE_W = null;
			private AggregateParameter _ADDRESS_EMAIL_W = null;
			private AggregateParameter _EMPLOYEE_DESCRIPTION_W = null;
			private AggregateParameter _CREATE_DATE_W = null;
			private AggregateParameter _CREATE_BY_W = null;
			private AggregateParameter _UPDATE_DATE_W = null;
			private AggregateParameter _UPDATE_BY_W = null;

			public void AggregateClauseReset()
			{
				_ID_W = null;
				_EMPLOYEE_CODE_W = null;
				_EMPLOYEE_NAME_W = null;
				_EMPLOYEE_LASTNAME_W = null;
				_EMPLOYEE_PREFIX_W = null;
				_EMPLOYEE_SEX_W = null;
				_EMPLOYEE_POSITION_ID_W = null;
				_EMPLOYEE_DEPARTMENT_ID_W = null;
				_EMPLOYEE_BIRTHDATE_W = null;
				_EMPLOYEE_JOINDATE_W = null;
				_EMPLOYEE_IMAGE_W = null;
				_ADDRESS_ADDRESS1_W = null;
				_ADDRESS_TUMBON_W = null;
				_ADDRESS_AUMPUR_W = null;
				_ADDRESS_PROVINCE_W = null;
				_ADDRESS_POSTCODE_W = null;
				_ADDRESS_PHONE_HOME_W = null;
				_ADDRESS_PHONE_MOBILE_W = null;
				_ADDRESS_EMAIL_W = null;
				_EMPLOYEE_DESCRIPTION_W = null;
				_CREATE_DATE_W = null;
				_CREATE_BY_W = null;
				_UPDATE_DATE_W = null;
				_UPDATE_BY_W = null;

				this._entity.Query.FlushAggregateParameters();

			}
	
			private BusinessEntity _entity;
			private TearOffAggregateParameter _tearOff;
			
		}
	
		public AggregateClause Aggregate
		{
			get
			{
				if(_aggregateClause == null)
				{
					_aggregateClause = new AggregateClause(this);
				}
		
				return _aggregateClause;
			}
		}
		
		private AggregateClause _aggregateClause = null;	
		#endregion
	
		protected override IDbCommand GetInsertCommand() 
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_EMPLOYEEInsert]";
	
			CreateParameters(cmd);
			
			SqlParameter p;
			p = cmd.Parameters[Parameters.ID.ParameterName];
			p.Direction = ParameterDirection.Output;
    
			return cmd;
		}
	
		protected override IDbCommand GetUpdateCommand()
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_EMPLOYEEUpdate]";
	
			CreateParameters(cmd);
			      
			return cmd;
		}
	
		protected override IDbCommand GetDeleteCommand()
		{
		
			SqlCommand cmd = new SqlCommand();
			cmd.CommandType = CommandType.StoredProcedure;
			cmd.CommandText = "[" + this.SchemaStoredProcedure + "proc_EMPLOYEEDelete]";
	
			SqlParameter p;
			p = cmd.Parameters.Add(Parameters.ID);
			p.SourceColumn = ColumnNames.ID;
			p.SourceVersion = DataRowVersion.Current;

  
			return cmd;
		}
		
		private IDbCommand CreateParameters(SqlCommand cmd)
		{
			SqlParameter p;
		
			p = cmd.Parameters.Add(Parameters.ID);
			p.SourceColumn = ColumnNames.ID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EMPLOYEE_CODE);
			p.SourceColumn = ColumnNames.EMPLOYEE_CODE;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EMPLOYEE_NAME);
			p.SourceColumn = ColumnNames.EMPLOYEE_NAME;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EMPLOYEE_LASTNAME);
			p.SourceColumn = ColumnNames.EMPLOYEE_LASTNAME;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EMPLOYEE_PREFIX);
			p.SourceColumn = ColumnNames.EMPLOYEE_PREFIX;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EMPLOYEE_SEX);
			p.SourceColumn = ColumnNames.EMPLOYEE_SEX;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EMPLOYEE_POSITION_ID);
			p.SourceColumn = ColumnNames.EMPLOYEE_POSITION_ID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EMPLOYEE_DEPARTMENT_ID);
			p.SourceColumn = ColumnNames.EMPLOYEE_DEPARTMENT_ID;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EMPLOYEE_BIRTHDATE);
			p.SourceColumn = ColumnNames.EMPLOYEE_BIRTHDATE;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EMPLOYEE_JOINDATE);
			p.SourceColumn = ColumnNames.EMPLOYEE_JOINDATE;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EMPLOYEE_IMAGE);
			p.SourceColumn = ColumnNames.EMPLOYEE_IMAGE;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.ADDRESS_ADDRESS1);
			p.SourceColumn = ColumnNames.ADDRESS_ADDRESS1;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.ADDRESS_TUMBON);
			p.SourceColumn = ColumnNames.ADDRESS_TUMBON;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.ADDRESS_AUMPUR);
			p.SourceColumn = ColumnNames.ADDRESS_AUMPUR;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.ADDRESS_PROVINCE);
			p.SourceColumn = ColumnNames.ADDRESS_PROVINCE;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.ADDRESS_POSTCODE);
			p.SourceColumn = ColumnNames.ADDRESS_POSTCODE;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.ADDRESS_PHONE_HOME);
			p.SourceColumn = ColumnNames.ADDRESS_PHONE_HOME;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.ADDRESS_PHONE_MOBILE);
			p.SourceColumn = ColumnNames.ADDRESS_PHONE_MOBILE;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.ADDRESS_EMAIL);
			p.SourceColumn = ColumnNames.ADDRESS_EMAIL;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.EMPLOYEE_DESCRIPTION);
			p.SourceColumn = ColumnNames.EMPLOYEE_DESCRIPTION;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.CREATE_DATE);
			p.SourceColumn = ColumnNames.CREATE_DATE;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.CREATE_BY);
			p.SourceColumn = ColumnNames.CREATE_BY;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.UPDATE_DATE);
			p.SourceColumn = ColumnNames.UPDATE_DATE;
			p.SourceVersion = DataRowVersion.Current;

			p = cmd.Parameters.Add(Parameters.UPDATE_BY);
			p.SourceColumn = ColumnNames.UPDATE_BY;
			p.SourceVersion = DataRowVersion.Current;


			return cmd;
		}
	}
}
